package cn.iocoder.yudao.hires.mapper;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.hires.entity.ResumeMainDO;
import cn.iocoder.yudao.hires.vo.ResumeMainPageReqVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface ResumeMainMapper extends BaseMapperX<ResumeMainDO> {

    default PageResult<ResumeMainDO> selectPage(ResumeMainPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ResumeMainDO>().eqIfPresent(ResumeMainDO::getUserId, reqVO.getUserId()).likeIfPresent(ResumeMainDO::getName, reqVO.getName()).likeIfPresent(ResumeMainDO::getImages, reqVO.getImages()).betweenIfPresent(ResumeMainDO::getCreateTime, reqVO.getCreateTime()).orderByDesc(ResumeMainDO::getId));
    }


    /**
     * 根据职位id  获取简历数据
     *
     * @param categoryId 职位字典id
     * @return 简历数据
     */
    List<Map<String, Object>> resumeLibrary(@Param("categoryId") Integer categoryId);

}
